/*--------------------------------------------------------------------------
  Project::HEXAGON FLIGHT SIMULATOR
  Package::Controller
  Class::Controller
  File Controller.h
  --------------------------------------------------------------------------
  * METHODS AND CLASS PARAMETERS


  --------------------------------------------------------------------------
  * FUNCTIONS DESCRIPTION
  
  --------------------------------------------------------------------------
  * COPYRIGHT

  --------------------------------------------------------------------------
  * INFO ABOUT AUTHOR AND VERSIONS
  Author:	Tino Giorgio	Data: 
  Rev1:			Data:

  --------------------------------------------------------------------------
  * E-MAIL & CONTACTS

  GIORGIO TINO:	tinoshi@libero.it
	           	shapeofangels@hotmail.com
	            giorgio.tino@studenti.polito.it

  --------------------------------------------------------------------------*/

#if !defined(CONTROLLER_H)
#define CONTROLLER_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/* Standard includes */
#include <stdio.h>

/* PLIB includes */
#include <plib/ul.h>
#include <plib/js.h>

/* Project classes includes*/
#include "Defines.h"
#include "Joystick.h"
#include "Keyboard.h"
#include "Mouse.h"

/* Defines */
#define CONTROLLER_JOYSTICK	0x1
#define CONTROLLER_KEYBOARD 0x2
#define CONTROLLER_MOUSE    0x4

class Controller  
{
public:
	Controller ();
	virtual ~Controller ();

	void readKeyPress( int key, int updn, int x, int y );
	void readMousePosition( int x, int y );
	void readMouseButtons( int button, int updn, int x, int y );
	void readJoystick();
    void readMouse();
	int readKeyboard();
	int readInputs();

private:
	// Print available controls
	void printDeviceStatus();

	/* Controllers */
	Keyboard	 *kb;
	Mouse		 *ms;
	Joystick	 *js;

	/* Devices found */
	unsigned char devices;
};

#endif // !defined(CONTROLLER_H)
